package com.sunny.springboot2.controller;

import com.sunny.springboot2.core.annotation.LocalLock;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 本地锁
 * @author sunny
 * @date 2018/11/27
 */
@RestController
@RequestMapping("/noPer/localLock")
public class LocalLockController {

    @LocalLock(key = "lock:arg[0]")
    @GetMapping("lock")
    public String query(@RequestParam String token) {
        return "success - " + token;
    }
}
